package com.baidu.rs.server;

import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;

import com.baidu.domain.Car;
import com.baidu.domain.User;
import com.baidu.service.IUserService;
import com.baidu.service.UserServiceImpl;

public class RS_Server {

	public static void main(String[] args) {
		// 创建接口实现对象
		IUserService userService = new UserServiceImpl();
		// 创建服务
		final JAXRSServerFactoryBean jaxrsServerFactoryBean = new JAXRSServerFactoryBean();
		jaxrsServerFactoryBean.setResourceClasses(User.class,Car.class);
		jaxrsServerFactoryBean.setServiceBean(userService);
		jaxrsServerFactoryBean.setAddress("http://localhost:9996");
		
		// 发布服务
		jaxrsServerFactoryBean.create();
	}
}
